package com.jp.knowledge.my.adapter;

import android.content.Context;
import android.support.annotation.NonNull;
import android.widget.TextView;

import com.jp.knowledge.R;
import com.jp.knowledge.model.UserData;
import com.jp.knowledge.my.base.RecycleVAdapter;
import com.jp.knowledge.my.base.RecycleVHolder;

import java.util.List;

/**
 * @author gzejia 978862664@qq.com
 */
public class MyFileAboutAdapter extends RecycleVAdapter<UserData.SkillsBean> {

    public MyFileAboutAdapter(Context context, @NonNull List<UserData.SkillsBean> list) {
        super(context, list);
    }

    @Override
    public int getLayoutId(int viewType) {
        return R.layout.item_my_file_about;
    }

    @Override
    public void onBind(RecycleVHolder holder, int position) {
        TextView textView = holder.getTextView(R.id.item_file_tv_about);
//        if (getData(position).getIsChecked()==1) {
//            textView.setTextColor(context.getResources().getColor(R.color.white));
//            textView.setBackgroundResource(R.color.blue);
//        } else {
//            textView.setTextColor(context.getResources().getColor(R.color.black));
//            textView.setBackgroundResource(R.drawable.my_file_item_normal);
//        }
        try {
            UserData.SkillsBean  skillsBean = getData(position);
            if(skillsBean!=null){
                textView.setText(skillsBean.getSkillName());
            }else {
                mList.remove(position);
                notifyDataSetChanged();
            }

        }catch (Exception e){

        }

    }
}
